package com.neusoft.controller;

import com.alibaba.fastjson.JSON;
import com.neusoft.mapper.CommentMapper;
import com.neusoft.utils.SqlSessionFactoryUtils;
import com.neusoft.vo.Comment;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.PrintWriter;
import java.util.List;

@RestController
public class CommentController {
    @Resource
    CommentMapper commentMapper;
    @GetMapping("/api/articles/comments")
    public List<Comment> getComments(){
        return commentMapper.getAllComments();
    }
}
